import { request } from '@/api/modules/weatherRequest'

const api_WEATHERId = import.meta.env.VITE_APP_WEATHERId
const api_WEATHERData = import.meta.env.VITE_APP_WEATHERData

// 请求获取天气id接口
export const getWeatherCityId = (data) => {
  return request({
    url: api_WEATHERId + `/v2/city/lookup?location=${data}&key=1e643c1a2d904021a86c0d89cc8e49c9`
  })
}

// 请求获取天气接口
export const getWeather = (data) => {
  return request({
    url: api_WEATHERData + `/v7/weather/now?location=${data}&key=1e643c1a2d904021a86c0d89cc8e49c9`
  })
}

// 请求获取Pm2P5接口
export const getWeatherPm2P5 = (data) => {
  return request({
    url: api_WEATHERData + `/v7/air/now?location=${data}&key=1e643c1a2d904021a86c0d89cc8e49c9`
  })
}
